import request from "@/utils/request";
import qs from "qs";
/**
 * 获取地址库数据
 * @returns
 */
export function GetAreaCity(data) {
  return request({
    url: "/AreaCity/Query",
    method: "post",
    data,
  });
}

/**
 * 获取对应省市区相关的数据集合
 * @param {*} data
 * @returns
 */
export function GetAreaCitys(data) {
  return request({
    url: "/AreaCity/GetAreaCitys?" + qs.stringify(data),
    method: "get",
  });
}

/**
 * 新增地址
 * @param {*} data
 * @returns
 */
export function AddAreaCity(data) {
  return request({
    url: "/AreaCity/Create",
    method: "post",
    data,
  });
}

/**
 * 编辑地址
 * @param {*} data
 * @returns
 */
export function EditAreaCity(data) {
  return request({
    url: "/AreaCity/Update",
    method: "post",
    data,
  });
}

/**
 * 删除地址
 * @param {*} data
 * @returns
 */
export function DelAreaCity(data) {
  return request({
    url: "/AreaCity/Delete?" + qs.stringify(data),
    method: "get",
  });
}

/**
 * 获取全局树状地址
 * @param {*} data
 * @returns
 */
export function GetAreaCityTree() {
  return request({
    url: "/AreaCity/AreaCityTree",
    method: "get",
  });
}
